<?php

namespace App\Kuafu\User\Enum;

use App\Kuafu\Base\Enum\BaseCodeEnum;

class UserCacheEnum extends BaseCodeEnum
{
    private const USER_ROLE_ID = 'user-role-id';
    private const USER_SHOP_IDS = 'user-shop-ids';

    /**
     * user_role_mapping通过user_id查询的数据
     * @return string
     */
    public static function getUserRoles(int $userId): string
    {
        return sprintf(self::USER_ROLE_ID . ":%d", $userId);
    }

    /**
     * 用户关联的店铺
     * @param int $userId
     * @param int $platform
     * @return string
     */
    public static function getUserShopIds(int $userId, int $platform): string
    {
        return sprintf(self::USER_SHOP_IDS . ":%d:%d", $userId, $platform);
    }
}
